package com.zzyl.nursing.mapper.member;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.domain.Reservation;
import com.zzyl.nursing.vo.ReservationCountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author zbr
 * @version 1.0
 * @since 2025/3/5 21:25
 */
@Mapper
public interface MemberReservationMapper extends BaseMapper<Reservation> {

    /**
     * 查询每个时间段剩余预约次数
     *
     * @param startTime
     * @param endTime
     * @return
     */
    List<ReservationCountVo> getCountByTime(@Param("startTime") LocalDateTime startTime,@Param("endTime") LocalDateTime endTime);

    /**
     * 查询取消预约数量
     *
     * @param userId
     * @param startTime
     * @param endTime
     * @return
     */
    List<Reservation> getCancelledReservationCount(@Param("userId") Long userId,@Param("startTime") LocalDateTime startTime,@Param("endTime") LocalDateTime endTime);
}
